package com.ceba.test.base.dbdata.modules;
import com.ceba.base.dbdata.DataTableObject;
import com.ceba.base.dbdata.MysqlUtils;
public class InvalidDb {

	public static void init() throws Exception{
		//40-start
		DataTableObject cb_report_invalid=new DataTableObject("cb_report_invalid");
		cb_report_invalid.addField("ID", "varchar(32)", "NOT NULL", "", "true");
		cb_report_invalid.addField("REPORTID", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("ISSUER", "varchar(255)", "DEFAULT NULL", "发颁机构", "false");
		cb_report_invalid.addField("ISSUER_O", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("SUBJECT_O", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("SUBJECT", "varchar(255)", "DEFAULT '0'", "", "false");
		cb_report_invalid.addField("SIGN_TIME", "varchar(255)", "DEFAULT NULL", "文档签名时间", "false");
		cb_report_invalid.addField("VALID_STARTTIME", "varchar(255)", "DEFAULT NULL", "有效期起始时间", "false");
		cb_report_invalid.addField("VALID_ENDTIME", "varchar(255)", "DEFAULT NULL", "有效期结束时间", "false");
		cb_report_invalid.addField("VERFI_RESULT", "varchar(255)", "DEFAULT NULL", "签名文档的结果--是否被修改且证书是否有效", "false");
		cb_report_invalid.addField("OBJECTID", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("ALG", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("CODE", "varchar(255)", "DEFAULT '0'", "", "false");
		cb_report_invalid.addField("FILE_NAME", "varchar(255)", "DEFAULT NULL", "文档名称，特指作废文档的名称", "false");
		cb_report_invalid.addField("TRUST_STATE", "varchar(255)", "DEFAULT NULL", "授信状态", "false");
		cb_report_invalid.addField("CER_NUM", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("TRUST_FLAG", "varchar(255)", "DEFAULT NULL", "证书的授信code值", "false");
		cb_report_invalid.addField("INVALID_FILE_ID", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("ANNEX1_FILE_ID", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("ANNEX2_FILE_ID", "varchar(255)", "DEFAULT '0'", "", "false");
		cb_report_invalid.addField("REASON", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("FILE_HASH", "varchar(255)", "DEFAULT NULL", "文档哈希值", "false");
		cb_report_invalid.addField("STATUS", "varchar(255)", "DEFAULT NULL", "文档审批的状态:0未通过，1通过，2待审批", "false");
		cb_report_invalid.addField("UPLOAD_USER_IP", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("CREATE_USER_NAME", "varchar(255)", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("CREATE_TIME", "datetime", "DEFAULT NULL", "", "false");
		cb_report_invalid.addField("CREATE_USER", "varchar(32)", "DEFAULT NULL", "", "false");
		MysqlUtils.syncTableStructure(cb_report_invalid);
		//end
		
		//43-start
		DataTableObject msg_email_valid_log=new DataTableObject("msg_email_valid_log");
		msg_email_valid_log.addField("id", "varchar(32)", "NOT NULL", "", "true");
		msg_email_valid_log.addField("create_user", "varchar(32)", "NOT NULL", "", "false");
		msg_email_valid_log.addField("addresss", "varchar(500)", "NOT NULLL", "", "false");
		msg_email_valid_log.addField("signFlag", "varchar(1)", "DEFAULT NULL", "", "false");
		msg_email_valid_log.addField("sendStatus", "varchar(1)", " NOT NULL", "", "false");
		msg_email_valid_log.addField("fileids", "varchar(680)", " NOT NULL", "", "false");
		msg_email_valid_log.addField("reportId", "varchar(32)", " NOT NULL", "", "false");
		msg_email_valid_log.addField("title", "varchar(500)", " NOT NULL", "", "false");
		msg_email_valid_log.addField("name", "varchar(500)", "DEFAULT NULL", "", "false");
		msg_email_valid_log.addField("content", "text", "NOT NULL", "", "false");
		msg_email_valid_log.addField("templateId", "varchar(32)", "DEFAULT NULL", "", "false");
		msg_email_valid_log.addField("create_date", "datetime", "NOT NULL", "", "false");
		msg_email_valid_log.addField("remark", "varchar(500)", "DEFAULT NULL", "", "false");
		msg_email_valid_log.addField("spare1", "varchar(500)", "DEFAULT NULL", "", "false");
		msg_email_valid_log.addField("spare2", "varchar(500)", "DEFAULT NULL", "", "false");
		msg_email_valid_log.addField("spare3", "varchar(500)", "DEFAULT NULL", "", "false");
		MysqlUtils.syncTableStructure(msg_email_valid_log);
		//end 
		insertDefaultData();
		addIndex();
	}

	//默认权限
	public static void insertDefaultData() {

	}

	public static void addIndex() throws Exception {
		MysqlUtils.syncFieldIndex("cb_report_invalid","REPORTID");
	}
}
